]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Implemented banner support for the login screen
authorMatthias Clasen <mclasen@redhat.com>
Fri, 6 Jul 2012 01:11:22 +0000 (21:11 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 6 Jul 2012 13:01:25 +0000 (09:01 -0400)
Based on a patch by Marius Rieder,
https://bugzilla.gnome.org/review?bug=665346

data/theme/gdm.css
js/gdm/loginDialog.js

index e8e4d2a9d39df60c7c2c153d7bba3fda5b6b42bc..daaa57546f02bdf7e874d66f69684beea58eff88 100644 (file)
 
 /* Login Dialog */
 
+.login-dialog-banner {
+    font-size: 10pt;
+    font-weight: bold;
+    text-align: center;
+    color: #666666;
+    padding-bottom: 1em;
+}
+
 .login-dialog-title {
     font-size: 14pt;
     font-weight: bold;
index c00c21442f57036f49c75f8673155c493675d071..6ea415140dfda1be010ccbb78d1c1254747e187c 100644 (file)
@@ -49,6 +49,8 @@ const _LOGO_ICON_NAME_SIZE = 48;
 
 const _LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
 const _FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication';
+const _BANNER_MESSAGE_KEY = 'banner-message-enable';
+const _BANNER_MESSAGE_TEXT_KEY = 'banner-message-text';
 
 const _LOGO_KEY = 'logo';
 
@@ -780,11 +782,20 @@ const LoginDialog = new Lang.Class({
         this._startFingerprintConversationIfNeeded();
         this._settings.connect('changed::' + _LOGO_KEY,
                                Lang.bind(this, this._updateLogo));
+        this._settings.connect('changed::' + _BANNER_MESSAGE_KEY,
+                               Lang.bind(this, this._updateBanner));
+        this._settings.connect('changed::' + _BANNER_MESSAGE_TEXT_KEY,
+                               Lang.bind(this, this._updateBanner));
 
         this._logoBox = new St.Bin({ style_class: 'login-dialog-logo-box' });
         this.contentLayout.add(this._logoBox);
         this._updateLogo();
 
+        this._bannerLabel = new St.Label({ style_class: 'login-dialog-banner',
+                                           text: '' });
+        this.contentLayout.add(this._bannerLabel);
+        this._updateBanner();
+
         this._titleLabel = new St.Label({ style_class: 'login-dialog-title',
                                           text: C_("title", "Sign In") });
 
@@ -917,6 +928,18 @@ const LoginDialog = new Lang.Class({
 
     },
 
+    _updateBanner: function() {
+        let enabled = this._settings.get_boolean(_BANNER_MESSAGE_KEY);
+        let text = this._settings.get_string(_BANNER_MESSAGE_TEXT_KEY);
+
+        if (enabled && text) {
+            this._bannerLabel.set_text(text);
+            this._fadeInBanner();
+        } else {
+            this._fadeOutBanner();
+        }
+    },
+
     _onReset: function(client, serviceName) {
         this._greeterClient.call_start_conversation(_PASSWORD_SERVICE_NAME);
         this._startFingerprintConversationIfNeeded();
@@ -1284,6 +1307,14 @@ const LoginDialog = new Lang.Class({
         return _fadeOutActor(this._logoBox);
     },
 
+    _fadeInBanner: function() {
+        return _fadeInActor(this._bannerLabel);
+    },
+
+    _fadeOutBanner: function() {
+        return _fadeOutActor(this._bannerLabel);
+    },
+
     _fadeInTitleLabel: function() {
         return _fadeInActor(this._titleLabel);
     },